<template>
  <!-- 最外层框 -->
  <div class="details">
    <!-- 顶部框 -->
    <div class="topbar">
      <p class="new">资料详情</p>
      <span @click="closeClick" class="closeClick">
        <i class="el-icon-close"></i>
      </span>
      <size-list class="size_list" :sizeKindId="sizeKindId"></size-list>
    </div>
    <!-- 中间框 -->
    <div class="center_box">
      <p class="new">厂商建档</p>
      <i class="el-icon-question" @click="OIclick"></i>
      <!-- <div class="center_box1">
        <div class="center_box1c">
         <p class="contener">*</p><p class="sty">厂商编号</p><p>{{detailInfo.no}}</p>
        </div>
        <div class="center_box1c">
         <p class="contener_a">*</p><p class="sty">厂商简称</p><p>{{detailInfo.name}}</p>
        </div>
        <div class="center_box1c jl">
         <p class="contener1">厂商全称</p><p>{{detailInfo.nameAll}}</p>
        </div>
        <div class="center_box1c jl">
         <p class="contener1">负责人员</p><p>{{detailInfo.principal}}</p>
        </div>
        </div> -->
      <div class="c_c1">
        <div class="c_left">
          <div class="c_left1">
            <span>*</span>
            <p>厂商编号</p>
            <p class="c_p2">{{ detailInfo.no }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p">币种</p>
            <p class="c_p1">{{ detailInfo.name }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p">传真</p>
            <p class="c_p1">{{ detailInfo.nameAll }}</p>
          </div>
        </div>

        <div class="c_left">
          <div class="c_left1">
            <span>*</span>
            <p>厂商简称</p>
            <p class="c_p2">{{ detailInfo.name }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p">折数</p>
            <p class="c_p1">{{ detailInfo.discount }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p">地址</p>
            <p class="c_p1">{{ detailInfo.address }}</p>
          </div>
        </div>

        <div class="c_left">
          <div class="c_left1">
            <p class="c_p3">厂商全称</p>
            <p>{{ detailInfo.nameAll }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p">电话</p>
            <p class="c_p1">{{ detailInfo.phone }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p">备注</p>
            <p class="c_p1">{{ detailInfo.remark }}</p>
          </div>
        </div>

        <div class="c_left">
          <div class="c_left1">
            <p class="c_p4">负责人员</p>
            <p>{{ detailInfo.principal }}</p>
          </div>
          <div class="c_left1">
            <p class="c_p3">联系人员</p>
            <p>{{ detailInfo.contact }}</p>
          </div>
        </div>
      </div>

      <!-- <div class="center_box2">
        <div class="center_box1c">
         <p class="contener1">币种</p><p>{{detailInfo.curencyType}}</p>
        </div>
        <div class="center_box1c">
         <p class="contener1">折数</p><p>{{detailInfo.discount}}</p>
        </div>
        <div class="center_box1c">
         <p class="contener1">电话</p><p>{{detailInfo.phone}}</p>
        </div>
        <div class="center_box1c">
         <p class="contener1">联系人员</p><p>{{detailInfo.contact}}</p>
        </div>
        </div>

        <div class="center_box2">
          <div class="center_box1c">
         <p class="contener1">传真</p><p>{{detailInfo.fax}}</p>
        </div>
        <div class="center_box1c">
         <p class="contener1">地址</p><p>{{detailInfo.address}}</p>
        </div>
        <div class="center_box1c">
         <p class="contener1">备注</p><p>{{detailInfo.remark}}</p>
        </div>
        </div> -->
    </div>

    <!-- 下部框 -->
    <div class="foot">
      <!-- 条码建档 -->
      <div class="foot_1">
        <p class="new">条码建档</p>
        <i class="el-icon-question" @click="OIclick"></i>
        <div class="foot_input">
          <p class="con">条码规律</p>
          <p>{{ detailInfo.brandedCompany }}</p>
          <p class="contener3">种类尺码</p>
          <p>{{ sizeKindId }}</p>
        </div>
      </div>
      <!-- 条码位数 -->
      <div class="foot_1">
        <p class="new">条码位数</p>
        <i class="el-icon-question" @click="OIclick"></i>
        <div class="foot_input">
          <p class="contener2">款号</p>
          <p class="jl">{{ styleNumber }}</p>
          <p class="contener4">色号/尺码</p>
          <p class="jl">{{ colorNumber }}</p>
          <p class="contener4">验证码</p>
          <p class="jl">{{ code }}</p>
          <p class="contener4">拆分</p>
          <p class="jl">{{ splitNumber }}</p>
        </div>
      </div>
      <!-- 分隔开关 -->
      <div class="foot_3">
        <p class="new">分隔开关</p>
        <i class="el-icon-question" @click="OIclick"></i>
        <div class="foot_contener1">
          <p class="contener5">款号与颜色之间是否有"——"</p>
          <p>{{ styleColor }}</p>
          <p class="contener6">是否为款号、尺码、颜色</p>
          <p>{{ styleColorSize }}</p>
        </div>

        <div class="foot_contener1">
          <p class="contener5">色号与尺码之间是否有"——"</p>
          <p>{{ colorSize }}</p>
          <p class="contener7">条码与货号是否一致</p>
          <p>{{ barCodeArticleNumberEqual }}</p>
        </div>

        <div class="foot_contener1">
          <p class="contener5">末尾为售价 售价隔开符</p>
          <p>{{ partitionPrice }}</p>
        </div>
      </div>

      <!-- 底部说明 -->
      <div class="explain">
        <i class="el-icon-question" @click="OIclick"></i>
        <p>说明：</p>
        <p
          style="display: inline; color: #017aff; cursor: pointer"
          @click="OIclick"
        >
          条码与货号的区别，与操作说明
        </p>
      </div>
    </div>

    <!-- 操作说明图片 -->
    <OIimg :style="{ display: showOI }" @closeOI="closeOI"></OIimg>
  </div>
</template>

<script>
import sizeList from './SizeList'
import OIimg from './OIimg'
import { getBarCode } from '../../../../network/manufacturer'

export default {
  props: {
    detailInfo: {
      type: Object,
      default: {}
    }
  },
  created() {
    console.log(this.detailInfo, 'detailInfo')
  },
  data() {
    return {
      AList: [],
      no: '',
      name: '',
      nameAll: '',
      principal: '',
      curencyType: '',
      discount: '',
      phone: '',
      contact: '',
      fax: '',
      address: '',
      remark: '',
      ed: '',
      sizeKindId: '',
      styleNumber: '',
      colorNumber: '',
      code: '',
      splitNumber: '',
      brandedCompany: '',
      styleColor: '',
      styleColorSize: '',
      colorSize: '',
      barCodeArticleNumberEqual: '',
      partitionPrice: '',
      showOI: 'none'
    }
  },
  methods: {
    closeClick() {
      return this.$emit('closeClick')
    },
    // 点击显示图片
    OIclick() {
      this.showOI = 'block'
    },
    closeOI() {
      this.showOI = 'none'
    }
  },
  watch: {
    detailInfo(a, b) {
      if (a !== {}) {
        // console.log(this.detailInfo.brandedCompany)
        // this.Aid = this.detailInfo.brandedCompany
        // console.log(this.Aid)
        getBarCode({ company: this.detailInfo.brandedCompany }).then((res) => {
          this.AList = res.data.data
          // console.log(res)
          // for (const i of this.AList){
          //   if(i.company == this.detailInfo.brandedCompany){
          //     this.sizeKindId = i.sizeKindId
          //     this.styleNumber = i.styleNumber
          //     this.colorNumber = i.colorNumber
          //     this.code = i.code
          //     this.splitNumber = i.splitNumber
          //     this.styleColor = i.styleColor
          //     this.styleColorSize = i.styleColorSize
          //     this.colorSize = i.colorSize
          //     this.barCodeArticleNumberEqual = i.barCodeArticleNumberEqual
          //     this.partitionPrice = i.partitionPrice
          //   }
          // }
        })
      }
    }
  },
  components: {
    sizeList,
    OIimg
  }
}
</script>

<style scoped>
.con {
  margin: 0 18px 0 26px;
}

.c_left {
  width: 230px;
  height: 160px;
  /* border: 1px solid black; */
}
.c_left1 {
  display: flex;
}
.c_c1 {
  display: flex;
  margin: 30px 0 0 25px;
}
.c_p {
  margin: 20px 16px 0 45px;
}
.c_p1 {
  margin: 20px 0 0 0;
}
.c_left1 span {
  color: red;
  margin: 0 6px 0 0;
}
.c_p2 {
  margin: 0 0 0 13px;
}
.c_p3 {
  margin: 0 13px 0 10px;
}
.c_p4 {
  margin: 0 13px 20px 10px;
}
/* .color1{
  color: #757575;
} */
/* .jl{
  margin: 6px 70px 0 15px;
} */
/* .addres{
  margin-left: 58px;
}
.remarks{
  margin-left: 91px;
}
.person{
  margin-left: 16px;
}
.phone{
  margin-left: 75px;
}
.Fold{
  margin-left: 40px;
}
.currency{
  margin-left: 8px;
} */
.jl {
  width: 90px;
  padding-top: 5px;
}
.sty {
  margin-right: 16px;
}
.size_list {
  position: absolute;
  right: 24px;
  top: 330px;
}
.explain {
  width: 296px;
  height: 32px;
  border-radius: 20px;
  background: #f8f8f8;
  font-size: 14px;
  text-align: center;
  /* padding-top: 12px; */
  margin: 40px 0 0 25px;
  display: flex;
}
.explain i {
  margin: -4px 6px 0 5px;
}
.explain p {
  margin: 5px 0 0 10px;
}
.explain a {
  text-decoration: none;
  margin-top: 5px;
}

.foot_contener1 {
  margin-top: 15px;
  display: flex;
  width: 100%;
}
.details {
  width: 1000px;
  height: 773px;
  background-color: white;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 9%;
  z-index: 999;
}

/* 头部 */
.topbar {
  width: 100%;
  height: 48px;
  background-color: #f8f8f8;
}
.new {
  float: left;
  line-height: 48px;
  margin-left: 25px;
  font-weight: 800;
}
.new1 {
  width: 16px;
  height: 16px;
  background: #017aff;
  margin-top: 15px;
  border-radius: 50%;
}
.new1 p {
  height: 16px;
}
.closeClick {
  float: right;
  text-align: center;
  padding-top: 12px;
  width: 40px;
  height: 37px;
}
.center_box {
  width: 1000px;
  height: 222px;
  border-bottom: 1px dashed #dbdbdb;
}
.center_box1 {
  width: 100%;
  height: 45px;
  margin-top: 48px;
  display: flex;
  justify-content: space-around;
}
.center_box2 {
  width: 100%;
  height: 45px;
  display: flex;
  justify-content: space-around;
  /* justify-content: flex-end; */
  /* margin-right: 38px; */
}
.center_box1c {
  display: flex;
  /* margin-right: 50px; */
  width: 200px;
}
.contener {
  color: red;
  padding: 0 3px 0 23px;
}
.contener_a {
  color: red;
  padding: 0 3px 0 50px;
}
/* .contener1{
    padding: 0 16px 0 60px;
  } */

.foot {
  width: 100%;
  height: 478px;
  position: relative;
}
.foot_1 {
  width: 67%;
  height: 80px;
  margin-top: 10px;
}
.foot_3 {
  width: 67%;
  height: 160px;
  margin-top: 10px;
}
.foot_input {
  width: 100%;
  height: 40px;
  margin-top: 16px;
  display: flex;
}
.contener2 {
  margin: 6px 8px 0 26px;
}
.contener3 {
  margin: 0 18px 0 206px;
}
.contener4 {
  margin: 6px 8px 0 10px;
}
.contener5 {
  margin: 0 24px 0 26px;
}
.contener6 {
  margin: 0 24px 0 86px;
}
.contener7 {
  margin: 0 58px 0 86px;
}

.jl5 {
  position: relative;
  bottom: 5px;
  left: 6px;
}
.select {
  width: 160px;
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 3px;
}
</style>

<style>
.details .el-icon-question:before {
  color: #017aff;
  position: relative;
  left: 10px;
  top: 14px;
}
</style>
